/**
 * 
 */

var handlers = [ {
	pattern : '/.*\\.[Hh][Tt][Mm][Ll]?',
	js : '/response.file.js'
}, {
	pattern : '/.*\\.[Jj][Ss]',
	js : '/response.file.js'
}, {
	pattern : '.*/',
	js : '/response.file.js'
}, {
	pattern : '/webfinder/newWebSearcher\\.do',
	js : '/webfinder/createWebSearcher.js'
}, {
	pattern : '/objects/index.view',
	js : '/objects/object.list.js'
}, {
	pattern : '/objects/createObject.view',
	js : '/objects/object.create.js'
} ];

function handle(console, request, response) {
	var requestPath = request.getMethodPath();
	for (var i = 0; i < handlers.length; i++) {
		var config = handlers[i];
		if (console.execute('matches', [ requestPath, config['pattern'] ])) {
			var js = console.execute('find', config['js']);
			/**
			 * log(js);*/
			eval(js);
		}
	}
}
